package com.antoco.operation.bigscreen.utils;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.text.DateFormat;
import java.util.Date;

@Component
public class SystemUtil {
    @Getter
    @Value("${sys.conf.debug}")
    private Boolean debug;

    /**
     * 打印debug消息
     * @param message
     */
    public void printDebug(String message) {
        if (debug) {
            StringBuilder formattedMessage = new StringBuilder();
            formattedMessage.append("[DEBUG]").append(message);
            System.out.println(formattedMessage.toString());
        }
    }

    /**
     * 打印debug消息
     *
     * @param message
     * @param args
     */
    public void printfDebug(String message, Object ... args) {
        if (debug) {
            StringBuilder formattedMessage = new StringBuilder();
            formattedMessage.append("[DEBUG]").append(message);
            System.out.printf(formattedMessage.toString(), args);
        }
    }
}
